package cn.edu.nuc.fourth.controller;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.google.gson.Gson;

import cn.edu.nuc.fourth.model.SchoolMes;
import cn.edu.nuc.fourth.services.interfaces.FillingService;

@Controller
@RequestMapping("leader")
public class LeaderController {

	@Autowired
	private FillingService service;

	@RequestMapping("/school")
	public String forschool(Model model, Integer userid) {

		SchoolMes sm = service.echart(-1);
		Gson gson = new Gson();
		String schoolmes = gson.toJson(sm).toString();
		model.addAttribute("schoolmes", schoolmes);
		return "leader/schoolEcharts";
	}
}
